package com.xbongbong.paas.manager;

import com.xbongbong.paas.pojo.dto.DingtalkConfigGetDTO;
import com.xbongbong.paas.pojo.vo.DingtalkConfigGetVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.dingtalk.pojo.dto.CoolAppAccessStatusDTO;
import com.xbongbong.pro.dingtalk.pojo.dto.DingtalkBeforeConfigDTO;
import com.xbongbong.pro.dingtalk.pojo.dto.DingtalkLoginInfoDTO;
import com.xbongbong.pro.dingtalk.pojo.dto.GenerateNonceDTO;
import com.xbongbong.pro.dingtalk.pojo.vo.CoolAppAccessStatusVO;
import com.xbongbong.pro.dingtalk.pojo.vo.DingtalkBeforeConfigVO;
import com.xbongbong.pro.dingtalk.pojo.vo.DingtalkLoginInfoVO;
import com.xbongbong.pro.dingtalk.pojo.vo.GenerateNonceVO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 钉钉手机端接口远程调用
 * @author kaka
 * @time 2018-10-16 19:48
 */
public interface DingtalkManager {

    /**
     * 获取链接对应的签名认证信息
     * @param configGetDTO 业务相关DTO
     * @param request 请求request
     * @return 关联业务VO
     * @throws XbbException 业务异常
     */
    DingtalkConfigGetVO getConfig(HttpServletRequest request, DingtalkConfigGetDTO configGetDTO) throws XbbException;

    /**
     * 钉钉登录相关逻辑,TODO 登录后账号是否正常逻辑判断
     * @param request 相应request
     * @param response 相应response
     * @param loginInfoDTO 业务相关DTO
     * @return 关联业务VO
     * @throws XbbException 业务异常
     */
    DingtalkLoginInfoVO loginInfo(HttpServletRequest request, HttpServletResponse response, DingtalkLoginInfoDTO loginInfoDTO) throws XbbException;

    /**
     * 用于web端登录生成随机数跳转
     * @param generateNonceDTO 业务相关DTO
     * @return 关联业务VO
     * @throws XbbException 业务异常
     */
    GenerateNonceVO generateNonce(GenerateNonceDTO generateNonceDTO) throws XbbException;
    
    /**
     * @throws XbbException 业务异常
     */
    DingtalkBeforeConfigVO beforeConfig(DingtalkBeforeConfigDTO dingtalkBeforeConfigDTO) throws XbbException;

    /***
     * 获取酷应用状态
     *
     * @param coolAppAccessStatusDTO
     * @throws
     * @return String
     * @author hongxiao
     * @date 2022-09-06 15:30
     */
    CoolAppAccessStatusVO getCoolAppAccessStatus(CoolAppAccessStatusDTO coolAppAccessStatusDTO);

}
